
import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

const state = {
    count: 0,
    title:'首页',
    httpUrl:'http://39.96.171.14:8080'
}

const mutations = {
    add(state,n = 0){
        return (state.count += n)
    },
    reduce(state, n = 0){
        return (state -= n);
    },
    changeTitle(state,newTitle){
        return (state.title = newTitle);
    }
}

export default new Vuex.Store({
    state,
    mutations
})